package com.yang.job.admin.application.task;



import com.yang.job.core.dto.ResultT;
import com.yang.job.core.execute.IYangJobExecutor;
import com.yang.job.core.execute.YangJobExecuteRequest;

import java.text.SimpleDateFormat;
import java.util.Date;

public class HelloWorldJobExecutor implements IYangJobExecutor {
    @Override
    public ResultT execute(YangJobExecuteRequest yangJobExecuteRequest) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String nowTime = simpleDateFormat.format(new Date());
        System.out.println(String.format("Hello world! jobId: %s, nowTime:%s", yangJobExecuteRequest.getJobId(), nowTime));
        return ResultT.success();
    }
}
